# Maintainer: Alexander Epaneshnikov <alex19ep@archlinux.org>
# Contributor: Brad Fanella <cesura@archlinux.org>
# Contributor: Martin Wimpress <code@flexion.org>

pkgname=pluma
pkgver=1.27.0
pkgrel=2
pkgdesc="A powerful text editor for MATE"
url="https://mate-desktop.org"
arch=('loong64' 'x86_64')
license=('GPL')
depends=('iso-codes' 'mate-desktop' 'zenity' 'gtksourceview4' 'libpeas' 'python' 'gettext' 'enchant' 'libsm')
makedepends=('itstool' 'gobject-introspection' 'python' 'mate-common' 'yelp-tools' 'autoconf-archive')
optdepends=('python-gobject: to use the python plugins')
groups=('mate-extra')
conflicts=('pluma-gtk3')
replaces=('pluma-gtk3')
source=("https://pub.mate-desktop.org/releases/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz")
sha512sums=('ce2ab6fb4f7cfa93b8b1c22a80b4a688f63f9ec61fd173c22684a9cb49a83551cc9e5ed45a04cec23683d85be059615d90abd7d6b7e4b3bf1b3d6287d4292f78')

prepare() {
	cd "${pkgname}-${pkgver}"
	./autogen.sh
}

build() {
	cd "${pkgname}-${pkgver}"
	./configure \
	            --prefix=/usr \
	            --libexecdir=/usr/lib/${pkgname} \
	            --enable-gtk-doc=no \
	            --enable-python

	#https://bugzilla.gnome.org/show_bug.cgi?id=656231
	sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

	make
}

package() {
	cd "${pkgname}-${pkgver}"
	make DESTDIR="${pkgdir}" install
}
